#include<iostream>
#include<vector>
/* 两数求和 */
class Solution{
public:
  std::vector<int> twoSum(std::vector<int> & nums, int target){
    std::vector<int>  * vec = new std::vector<int> ;
    for(int i=0; i<nums.size(); i++){
      for(int j=i+1;j<nums.size();j++){
	int sum = nums[i]+nums[j];
	if(sum == target){
	  vec->push_back(i);
	  vec->push_back(j);
	}
      }
    }
   
    return *vec;
  }
};


int main(){
  std::vector<int> fV{2,7,11,15};
  Solution * s = new Solution ;
  std::vector<int> v = s->twoSum(fV,9);
  for(int i=0; i<v.size();i++){
    std::cout << v[i] << "   " ;
  }
  return 0;
}
